## Data Cleaning
### Cleaning and some basic explore
dat <- read.csv("./CleanedMediumData.csv",header=T)
head(dat)
dim(dat)

datX <- dat[,1:55]
datY <- dat[,56:57]

#### Pre-processing (Center and scale)
## datX0 <- scale(datX, center=T, scale=T)
datX0 <- datX
head(datX0)
head(datY)


#### Put data together
lmdat <- cbind(datX0,datY[,c(1,2)])
colnames(lmdat)[56:57] = c("Y1","Y2")
colnames(lmdat)
saveRDS(lmdat,file="./dat.rds")
